package com.pkk.penguin.frame.know.java.driven.beanleftcycle;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @description: bean的声明周期管理
 * @author: peikunkun
 * @create: 2020-08-04 11:15
 **/
@Slf4j
@Configuration
@ComponentScan(basePackages = "com.pkk.penguin.frame.know.java.driven.beanleftcycle")
public class BeanLeftCycleMainTests {

  @Test
  public void Administrator_11_20200804111605_() {
    System.out.println("欢迎使用单元测试方法【Administrator_11()_20200804111605】");
    System.out.println("此方法测试描述：【bean的生命周期管理】");

    final AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(
        this.getClass());

    System.out.println("初始化bean完成");
    final Object beanLeftCycleBean = annotationConfigApplicationContext.getBean("beanLeftCycleBean");
    annotationConfigApplicationContext.close();

  }


}
